import { memo, useState } from "react"

const MemoSon = memo(function Son() {
    console.log("我是子组件 我重新渲染了")
    return <div>this is son</div>
})

// function Son(){
//     return <div>this is son</div>
// }

const User = () => {
    const [count, setCount] = useState(0)
    return (
        <div>
            <div>memo用法</div>
            <div onClick={() => setCount(count + 1)}>change count:{count}</div>
            {/* <Son/> */}
            <MemoSon />
        </div>
    )
}

export default User